<?php

namespace App\Traits;

trait EnumTrait
{
    /**
     * 获取所有const
     * @return array
     */
    protected static function getConstants()
    {
        $reflectionClass = new \ReflectionClass(self::class);
        return $reflectionClass->getConstants();
    }

    protected static function getConstantsByClass($Object)
    {
        $reflectionClass = new \ReflectionClass($Object);
        return $reflectionClass->getConstants();
    }

}
